/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.com.aptech.msh.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.constraints.Email;

/**
 *
 * @author trietto
 */
@Entity
@Table(name = "enquiry")
@NamedQueries({
    @NamedQuery(name = "Enquiry.findAll", query = "SELECT e FROM Enquiry e")})
public class Enquiry implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "EnquiryID")
    private Integer enquiryID;
    @Basic(optional = false)
    @Column(name = "Subject")
    private String subject;
    @Basic(optional = false)
    @Column(name = "SenderName")
    private String senderName;
    @Basic(optional = false)
    @Column(name = "SenderEmail")
    @Email
    private String senderEmail;
    @Basic(optional = false)
    @Lob
    @Column(name = "Content")
    private String content;
    @Basic(optional = false)
    @Column(name = "Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date date;
    @Column(name = "Status")
    private Integer status;

    public Enquiry() {
    }

    public Enquiry(Integer enquiryID) {
        this.enquiryID = enquiryID;
    }

    public Enquiry(Integer enquiryID, String subject, String senderName, String senderEmail, String content, Date date) {
        this.enquiryID = enquiryID;
        this.subject = subject;
        this.senderName = senderName;
        this.senderEmail = senderEmail;
        this.content = content;
        this.date = date;
    }

    public Integer getEnquiryID() {
        return enquiryID;
    }

    public void setEnquiryID(Integer enquiryID) {
        this.enquiryID = enquiryID;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getSenderEmail() {
        return senderEmail;
    }

    public void setSenderEmail(String senderEmail) {
        this.senderEmail = senderEmail;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (enquiryID != null ? enquiryID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Enquiry)) {
            return false;
        }
        Enquiry other = (Enquiry) object;
        if ((this.enquiryID == null && other.enquiryID != null) || (this.enquiryID != null && !this.enquiryID.equals(other.enquiryID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vn.com.aptech.msh.entities.Enquiry[enquiryID=" + enquiryID + "]";
    }

}
